# from struct import pack
# import time

# a = b'1231235\x00\x01123123lakdsjf;askdf;aksdnvcz,xncv.,zxcmv;lkdsjaf;dskjfiwjpefikjweiu892q340823475087107403895uiefhakjsdnvpq234pfdsakjbvpasiefriqpueiipasdfjasdkfj;'

# a_len = len(a)

# # print(a_len)
# # pre = time.time()
# # for i in range(int(10000000 / 3)):
# #     ss = pack(f"!II{a_len}s",1,3,a)

# # print((time.time() - pre))

# print(pack('!II', 0, 0))

import sys
import os
import logging

cur_file_path, filename = os.path.split(os.path.abspath(__file__))
sys.path.append(f"{cur_file_path}/../")


from l0n0lnet.confuse_tcp import confuse_server, confuse_client
from l0n0lnet.stream_parser import stream_parser
from l0n0lnet import run, add_quit_func
from l0n0lnet.commands import get_keys

keys = get_keys("C:\\softs\\代理\\pass.txt")

ss = confuse_server(b'0.0.0.0', 7777, keys)
sc = confuse_client(b'127.0.0.1', 7777, keys)


def on_close():
    ss.close()
    sc.close()
    print("quit")


add_quit_func(on_close)

run()